using System.Windows.Controls;
using Tryit.ViewModels;

namespace Tryit.Views
{
    public partial class ScheduleView : Page
    {
        public ScheduleView()
        {
            InitializeComponent();
        }

        private void TextBox_LostFocus(object sender, System.Windows.RoutedEventArgs e)
        {
            if (sender is TextBox textBox && textBox.Tag is ViewModels.CalendarDay day)
            {
                var viewModel = DataContext as ScheduleViewModel;
                viewModel?.UpdateScheduleCommand.Execute(day);
            }
        }
    }
} 